package com.hzjh.base.router.interceptor

import android.content.Context
import android.util.Log
import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.facade.annotation.Interceptor
import com.alibaba.android.arouter.facade.callback.InterceptorCallback
import com.alibaba.android.arouter.facade.template.IInterceptor

@Interceptor(priority = 1,name = "打印路由地址")
class ARouterInterceptor : IInterceptor {
    override fun init(context: Context?) {
        Log.d("ARouter","打印路由地址拦截器初始化")
    }

    override fun process(postcard: Postcard?, callback: InterceptorCallback?) {
        Log.d("ARouter","打印跳转路由${postcard?.path}")

        //交还控制权
        callback?.onContinue(postcard)
    }
}